import Vue from 'vue'
import App from './App'
import store from './store'
// import _ from 'lodash'
// Vue.prototype._= _

import MpvueRouterPatch from 'mpvue-router-patch'
Vue.use(MpvueRouterPatch)

Vue.config.productionTip = false
App.mpType = 'app'
Vue.prototype.$store = store
Vue.mixin({
  methods: {
    toastError(msg, icon = '') {
      wx.showToast({
        title: msg,
        icon:'none',
        duration: 2000
      })
        // image: '/static/images/icon_error.png',

    },
    toastSuccess(msg, icon = '') {
      wx.showToast({
        title: msg,
        icon:'success',
        duration: 2000
      })
    },
    filArry(arr){
      if(arr){
        return arr.filter(function(val){
          return !(!val || val === "");
        });
      }
      }
  }
})
const app = new Vue({
  store,
  ...App
})
app.$mount()

export default {
  // 这个字段走 app.json
  config: {
      // 页面前带有 ^ 符号的，会被编译成首页，其他页面可以选填，我们会自动把 webpack entry 里面的入口页面加进去
      pages: ['^pages/index/main', 'pages/user/main','pages/order/main' ],
      window: {
          backgroundTextStyle: 'light',
          navigationBarBackgroundColor: '#red',
          navigationBarTitleText: 'aaa',
          navigationBarTextStyle: 'black'
      },
      tabBar: {
          selectedColor: '#red',
          list: [
          {
              pagePath: 'pages/index/main',
              text: '主页',
              // iconPath: 'static/img/pkq.png',
              // selectedIconPath: 'static/img/pkq-active.png'
          },
          {
            pagePath: 'pages/order/main',
            text: '订单',
            // iconPath: 'static/img/pkq.png',
            // selectedIconPath: 'static/img/pkq-active.png'
        },
          {
              pagePath: 'pages/order/main',
              text: '个人',
              // iconPath: 'static/img/jlq.png',
              // selectedIconPath: 'static/img/jlq-active.png'
          }]
      }
  }
}
